import Vue from "vue";
import App from "./App.vue";
import router from "./router/index.js";
import store from "./store/index";

import FastClick from "fastclick";
import VueLazyLoad from "vue-lazyload";

import toast from "@/components/common/toast";

Vue.config.productionTip = false;
// 自定义插件,use导出的对象后，会执行对象的install函数
Vue.use(toast);

// 解决移动端300ms延迟
FastClick.attach(document.body);

// 使用图片懒加载
Vue.use(VueLazyLoad, {
  loading: require("./assets/img/common/placeholder.png")
});

// 注册事件总线
Vue.prototype.$bus = new Vue();

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
